//
//  NSObject+Common.m
//  GeniusHelp_OC
//
//  Created by 8b410-2 on 16/10/18.
//  Copyright © 2016年 8b410-2. All rights reserved.
//

#import "NSObject+Common.h"
@implementation NSObject (Common)
+ (NSString *)tipFromError:(NSError *)error {
    if (error && error.userInfo) {
        NSString *tipStr = [[NSMutableString alloc] init];
        if ([error.userInfo objectForKey:@"msg"]) {
            tipStr = [error.userInfo objectForKey:@"msg"];
        } else {
            if ([error.userInfo objectForKey:@"NSLocalizedDescription"]) {
                tipStr = [error.userInfo objectForKey:@"NSLocalizedDescription"];
            }
        }
        return tipStr;
    }
    return nil;
}
@end
